import api from '../http'
export const login = (username,password) => {
	return api.http({
		url:'/user/shop/login/password',
		data:{
			username,
			password
		},
		method:'post'
	}).catch(err => err)
}

export const register = (username,password) => {
	return api.http({
		url:'/user/shop/register',
		data:{
			username,
			password
		},
		method:'post'
	}).catch(err => err)
}


export const updateUser = (user) => {
	return api.http({
		url:`/user/shop/update`,
		method:'put',
		data:user
	})
}

//根据id获取用户数据
export const findUserById = (id) => {
	return api.http({
		url:`/user/admin/find/id/${id}`,
		method:'get',
	})
}

export const changePass = (user) => {
	return api.http({
		url:`/user/admin/password/change`,
		method:'post',
		data:user
	})
}